﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Diploma.Models.OrderDiplom>" %>
<%if (Model.OrderStatu.Value != 2){%>
    <form action="<%:Url.RouteUrl("Default", new {controller = "OrderDiplom", action = "UploadFile", orderId = Model.Id})%>"
        method="post" enctype="multipart/form-data">
        <input name="file" type="file" />
        <input type="submit" value="Загрузить" />
    </form>
<%}%>
<div class="order-document-list">
    <% var selectList = Model.VerifyDocuments.Select(r => new SelectListItem { Value = r.Id.ToString(), Text = r.Id.ToString() }); %>
    <% using (Html.BeginRouteForm("Default", new { action = "Content", controller = "OrderDiplom", orderId = Model.Id }, FormMethod.Post, new { id = "formFileActionMode" }))
       {%>
        <input id="fileActionMode" type="hidden" value="" name="action" />
        <%: Html.DropDownList("DocumentId", selectList)%>
        <input type="button" value="Скачать" onclick="$('#fileActionMode').val('download'); $('#formFileActionMode').submit(); return false;"/>
        <%if (Model.OrderStatu.Value != 2){%>
            <input type="button" value="Удалить" onclick="$('#fileActionMode').val('delete'); $('#formFileActionMode').submit(); return false;"/>
        <%}%>
    <% } %>
</div>